package com.goktech.olala.server.dao.goods;


import com.goktech.olala.core.req.ReqGoodsBrand;
import com.goktech.olala.core.resp.RespGoodsBrandVo;
import com.goktech.olala.server.dao.goods.sql.GoodsBrandSql;
import com.goktech.olala.server.pojo.goods.GoodsBrand;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @author wusq
 * 商品品牌dao层
 */
public interface GoodsBrandMapper {
    /**
     * 多条件的新增品牌
     * @param record
     * @return
     * @throws Exception
     */
    int insertByExample(GoodsBrand record) throws Exception;

    /**
     * 通过id删除品牌
     * @param brandId
     * @return
     * @throws Exception
     */
    int deleteByPrimaryKey(Long brandId) throws Exception;

    /**
     * 通过id查询品牌信息
     * @param brandId
     * @return
     * @throws Exception
     */
    GoodsBrand selectByPrimaryKey(Long brandId) throws Exception;

    /**
     * 查询所有品牌信息
     * @return
     * @throws Exception
     */
    List<GoodsBrand> selectAll() throws Exception;

    /**
     * 更新品牌
     * @param record
     * @return
     * @throws Exception
     */
    int updateByPrimaryKey(GoodsBrand record) throws Exception;

    /**
     * 多条件查询品牌信息
     * @param goodsBrandReq
     * @return
     */
    @SelectProvider(type= GoodsBrandSql.class, method = "selectBrandsByExample")
    List<RespGoodsBrandVo> selectByExample(ReqGoodsBrand goodsBrandReq);

}